//修改状态 通过 停用
$('.modifystatus').on('click',function(){
    var that = $(this);
    ShowCurrentTipBox();
    $('.a-confirm').on('click',function () {
        var id = that.attr('dataid');
        var status = that.attr('status');
        $.ajax({
            url:'/shop/modify-status',
            type:'post',
            data:{
                id:id,
                status:status,
            },
            dataType:'json',
            success:function(data){
                layer.msg(data.msg);
                setTimeout(function(){
                    location.href="/shop/index";
                },1200)

            }
        })
    });
    $('.a-cancel').on('click',function () {
       $('.a-div').hide();
    });

});

//二次弹窗
function ShowCurrentTipBox(){
    var dIv=$("<div class='a-div'><h4 class='a-h4'>提示</h4><p class='a-p'>您确定要<span class='a-span'>执行该操作</span>吗？</p><div class='a-btn'><input type='button' value='确认' class='a-confirm btn-primary'><input type='button' value='取消' class='a-cancel'></div></div>");
    $("body").append(dIv);
};


//驳回
$('.modifymtatustoregect').on('click',function(){
    var id = $(this).attr('dataid');
    ShowTextBox();
    $(".b-confirm").on("click",function(){
        var content=$(".b-text").val();
        ajax("post","/shop/modify-statustoregect",{id:id,dismissal:content},
            function success(data){
                layer.msg(data.msg);
                setTimeout(function(){
                    location.href="/shop/index";
                },1200)
            }
        );
    });
    $(".b-cancel").on("click",function(){
        $(".b-div").hide();
    })
});


